package com.sugar.queryinfo.module.business.dal.mysql.infocomparison;

import java.util.*;

import com.sugar.queryinfo.framework.common.pojo.PageResult;
import com.sugar.queryinfo.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.queryinfo.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.queryinfo.module.business.dal.dataobject.infocomparison.InfoComparisonDO;
import org.apache.ibatis.annotations.Mapper;
import com.sugar.queryinfo.module.business.controller.admin.infocomparison.vo.*;

/**
 * 智能比对 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface InfoComparisonMapper extends BaseMapperX<InfoComparisonDO> {

    default PageResult<InfoComparisonDO> selectPage(InfoComparisonPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<InfoComparisonDO>()
                .eqIfPresent(InfoComparisonDO::getUserId, reqVO.getUserId())
                .eqIfPresent(InfoComparisonDO::getDeptId, reqVO.getDeptId())
                .likeIfPresent(InfoComparisonDO::getName, reqVO.getName())
                .betweenIfPresent(InfoComparisonDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(InfoComparisonDO::getId));
    }

}